#ifndef CARDS_H
#define CARDS_H
#include"card.h"
#include <cards.h>
#include<QSet>
class Cards
{
public:
    Cards();
    Cards(const Card&card);

    enum SortType{Asc,Desc,Nosort};
    void add(const Card &card);
    void add(const Cards &cards);
    void add(const QVector<Cards>& cards);

    //一次性插入多条数据
    Cards& operator <<(const Card& card);
    Cards& operator <<(const Cards& cards);


    void remove(const Card &card);
    void remove(const Cards &cards);
    void remove(const QVector<Cards> &cards);

    int cardCount();
    bool isEmpty();
    void clear();

    Card::CardPoint maxpoint();
    Card::CardPoint minpoint();
    int pointcount(Card::CardPoint point);
    bool contains(const Card& card);
    bool contains(const Cards& cards);

    Card takeRandCard();
    QVector<Card> toCardList(SortType type = Desc)const;
private:
    QSet<Card> m_cards;
};

#endif // CARDS_H
